#ifndef __GEEK_COMMANDER_VIRTDIR_PROCESSOR_INCLUDED_E4B77AB6_E8DA_49a2_B231_6DAABAFBA806__
#define __GEEK_COMMANDER_VIRTDIR_PROCESSOR_INCLUDED_E4B77AB6_E8DA_49a2_B231_6DAABAFBA806__

#include "diritem.h"
#include "virtdir_processor.h"
#include "hash.h"

struct geek_gui_listpane;
struct geek_diritem_name_hsieh_hashfn;

struct geek_virtdir_processor
{
    geek_hash<geek_diritem,geek_diritem_name_hsieh_hashfn,&geek_diritem::name_hashnode> name_hash;
    geek_tree<geek_diritem,&geek_diritem::treenode> sort_tree;

    bool is_dirwalking;

    geek_gui_listpane *listpane;
};

bool geek_virtdir_processor_create(geek_virtdir_processor *p);
void geek_virtdir_processor_destroy(geek_virtdir_processor *p);

void geek_virtdir_processor_on_new_diritem(geek_virtdir_processor *p, geek_diritem *item);
void geek_virtdir_processor_on_update_diritem(geek_virtdir_processor *p, geek_diritem *item);
void geek_virtdir_processor_on_delete_diritem(geek_virtdir_processor *p, geek_diritem *item);

void geek_virtdir_processor_on_begin_dirwalk(geek_virtdir_processor *p);
void geek_virtdir_processor_on_end_dirwalk(geek_virtdir_processor *p);
void geek_virtdir_processor_on_cancel_dirwalk(geek_virtdir_processor *p);

int geek_virtdir_processor_get_items(geek_virtdir_processor *p, int start, int count, geek_diritem *buffer);

#endif // __GEEK_COMMANDER_VIRTDIR_PROCESSOR_INCLUDED_E4B77AB6_E8DA_49a2_B231_6DAABAFBA806__
